﻿/*密码复杂度判断*/
regPwd = /[#|_]/;
$(function () {
    var pwd = $("#cphMain_txtPwd");
    if (pwd != null) {
        pwd.blur(function () {
            var pwdStr = new String(pwd.val());
            var isPChar = regPwd.test(pwdStr);
            if (pwdStr.length >= 6 && pwdStr.length <= 10) {
                DisplayPwdStrength("A");
            }
            else if (!isPChar && pwdStr.length > 10) {
                DisplayPwdStrength("B");
            }
            else {
                DisplayPwdStrength("C");
            }
        });
    }
})

function DisplayPwdStrength(strongStr) {
    var pwdStrong = $(".pw_strength");
    if (pwdStrong != null) {
        pwdStrong.attr("class", "pw_strength pw_strength" + strongStr);
    }
}